package com.teemo.equipment.controller;

import com.teemo.equipment.biz.HeroBizService;
import com.teemo.equipment.domain.dto.HeroPageDTO;
import com.teemo.equipment.domain.vo.BasePageVO;
import com.teemo.equipment.domain.vo.HeroDetailVO;
import com.teemo.equipment.domain.vo.HeroPageVO;
import com.teemo.equipment.domain.vo.ResultVO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Teemo
 */
@RestController
@RequestMapping("/hero")
public class HeroController {

    @Resource
    private HeroBizService heroBizService;

    @GetMapping("/page")
    public ResultVO<BasePageVO<HeroPageVO>> page(HeroPageDTO dto){
        BasePageVO<HeroPageVO> page=  heroBizService.page(dto);
        return ResultVO.success(page);
    }

    @GetMapping("/detail")
    public ResultVO<HeroDetailVO> detail(@RequestParam Long id){
        HeroDetailVO detail=  heroBizService.detail(id);
        return ResultVO.success(detail);
    }

}
